from common.base import Base, By


# 定义SearchPage类
class SearchPage(Base):

    def goods_input(self, goods_name):
        # 定位输入框，输入数据
        self.find_element((By.ID, 'keyword')).send_keys(goods_name)

    def search_btn(self):
        # 定位搜索按钮，点击
        self.click((By.NAME, 'imageField'))

    def clear(self, locator):
        # 清空输入框内容
        self.find_element(locator).clear()

